import { defineStore } from "pinia";
export const useAppInfoStore = defineStore("appInfo", {
  state: () => {
    return {
      statusBar: 0,
      navBarHeight: 0,
      screeWidth: 0,
      screeHeight: 0,
      deviceId: "",
      deviceBrand: "",
      appVersion: "",
    };
  },
  actions: {
    setInfo(
      statusBar,
      navBarHeight,
      screeWidth,
      screeHeight,
      deviceId,
      deviceBrand,
      appVersion
    ) {
      this.statusBar = statusBar;
      this.navBarHeight = navBarHeight;
      this.screeWidth = screeWidth;
      this.screeHeight = screeHeight;
      this.deviceId = deviceId;
      this.deviceBrand = deviceBrand;
      this.appVersion = appVersion;
    },
    getInfo() {
      return {
        statusBar: this.statusBar,
        navBarHeight: this.navBarHeight,
        screeWidth: this.screeWidth,
        screeHeight: this.screeHeight,
        deviceId: this.deviceId,
        deviceBrand: this.deviceBrand,
        appVersion: this.appVersion,
      };
    },
  },
});
